package org.jg.arkanoid;

import javax.swing.JFrame;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import org.jg.arkanoid.controller.KeyBoardListener;
import org.jg.arkanoid.ui.*;

public class UIMain 
{
	private static Logger logger = LogManager.getLogger("UIMain.class");
	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{
		logger.info("Application started");
		
		MainFrameData mainFrameData = new MainFrameData();
		
		KeyBoardListener keyBoardListener = new KeyBoardListener();
		mainFrameData.setKeyBoardListener(keyBoardListener);
		
		MainFrameView mainFrameView = new MainFrameView( mainFrameData );
		
		GamePanel gamePanel = new GamePanel();
		
		mainFrameView.setPanel(gamePanel);
		
		mainFrameView.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		mainFrameView.setResizable(false);
		mainFrameView.setVisible(true);
		
		TheGame game = new TheGame();
		game.setGamePanel(gamePanel);
		game.setKeyListener(keyBoardListener);
		game.runGame();
	}

}
